<?php

if (validation_errors()) :
?>
<section class="content-header">
<div class='alert alert-block alert-error fade in'>
    <a class='close' data-dismiss='alert'>&times;</a>
    <h4 class='alert-heading'>
        <?php echo lang('price_errors_message'); ?>
    </h4>
    <?php echo validation_errors(); ?>
</div>
</section>
<?php
endif;

$id = isset($price->id) ? $price->id : '';

?>

<!-- <section class="content-header">
      <h1>
        General Form Elements
        <small>Preview</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="#">Forms</a></li>
        <li class="active">General Elements</li>
      </ol>
    </section> -->

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-xs-12">
        <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">编辑<?php echo lang('price_area_title'); ?></h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <?php echo form_open($this->uri->uri_string(), 'class="form-horizontal"'); ?>
              <div class="box-body">
                <div class="form-group">
                  <?php echo form_label(lang('price_field_price'), 'price', array('class'=>'col-sm-2 control-label')); ?>
                  <div class="col-sm-6">
                  <input id='price' type='text' required='required' name='price' class="form-control" maxlength='100' value="<?php echo set_value('price', isset($price->price) ? $price->price : ''); ?>"/>
                  </div>
                </div>
                <div class="form-group">
                  <?php echo form_label(lang('price_field_price_digit'), 'price_digit', array('class'=>'col-sm-2 control-label')); ?>
                  <div class="col-sm-6">
                  <input id='price_digit' type='text' required='required' name='price_digit' class="form-control" maxlength='100' value="<?php echo set_value('price_digit', isset($price->price_digit) ? $price->price_digit : ''); ?>"/>
                  </div>
                </div>
                <div class="form-group">
                  <?php echo form_label('选择城市', 'city_id', array('class'=>'col-sm-2 control-label')); ?>
                    <div class="col-sm-6">
                        <select class="form-control select2" style="width: 100%;" name="city_id" id="city_id">
                          <option selected="selected"  value="0">选择城市</option>
                          <?php foreach ($area as $area) : ?>
                          <option value="<?php echo $area->area_id; ?>" <?php if($area->area_id==$price->city_id): ?>selected<?php endif; ?>><?php echo $area->area_name; ?></option>
                          <?php endforeach; ?>
                        </select>
                    </div>
                </div>
              </div>
              <!-- /.box-body -->

              <div class="box-footer">
                <button type="submit" name='save' class="btn btn-primary">Submit</button>
                <?php echo anchor(SITE_AREA . '/content/price', lang('price_cancel'), 'class="btn btn-default pull-right"'); ?>
              </div>
            <?php echo form_close(); ?>
          </div>

          </div>
      </div>
</section>
